package com.ocr.entities;

import java.io.Serializable;
import java.util.Date;

public class HistoryItem implements Serializable,Comparable<HistoryItem>{
	private Date dateCreate;
	private String imgPath;
	private String result;
	
	public HistoryItem(Date dateCreate, String imgPath, String oCRResult) {
		super();
		this.dateCreate = dateCreate;
		this.imgPath = imgPath;
		result = oCRResult;
	}
	public Date getDateCreate() {
		return dateCreate;
	}
	public void setDateCreate(Date dateCreate) {
		this.dateCreate = dateCreate;
	}
	public String getImgPath() {
		return imgPath;
	}
	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}
	public String getOCRResult() {
		return result;
	}
	public void setOCRResult(String oCRResult) {
		result = oCRResult;
	}
	@Override
	public int compareTo(HistoryItem another) {
		// TODO Auto-generated method stub
		if(this.dateCreate.after(another.getDateCreate()))
			return -1;
		else if(dateCreate.before(another.getDateCreate()))
			return 1;
		return 0;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "date:"+dateCreate+", result:"+result;
	}
}
